<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

	public function _initDb(){
		$dbOption = $this->getOption("resources");
		$dbOption = $dbOption["db"];
		
		//setup database
		$db = Zend_Db::factory($dbOption["adapter"],$dbOption["params"]);
		
		$db->setFetchMode(Zend_Db::FETCH_ASSOC);
		$db->query("SET NAMES 'utf8'");
		$db->query("SET CHARACTER SET 'utf8'");
		
		Zend_Registry::set("connectDb", $db);
		Zend_Db_Table::setDefaultAdapter($db);
		return $db;
	}
	/* protected function _initFrontcontroller(){
		$front = Zend_Controller_Front::getInstance();
		$front->addModuleDirectory(APPLICATION_PATH . '/modules');
		$front->setDefaultModule('student');
		//$front->registerPlugin(new Zendvn_Plugin_Permission());
	
		return $front;
	} */

}

